1. Technical Field
The present invention relates to a system and method for adaptive span computation when ray casting. More particularly, the present invention relates to a system and method for using start point fractional values during view screen segment computations in order to prevent excessive sampling densities during image generation.
2. Description of the Related Art
The increase of computer system processing speeds has allowed today's computer systems to perform fairly accurate terrain rendering. In the computer gaming industry, for example, three dimensional terrain rendering is an essential element for providing a “visual reality” to computer games. In addition to the gaming industry, three-dimensional terrain rendering is utilized in other fields, such as in flight simulation.
Software developers may use “ray casting” for terrain rendering, which produces realistic images. In ray casting, a processor identifies an eye point location, which corresponds to a location at which a user views a view screen. Using the eye point location, the processor derives a down point, which is a point on a height map. Vertical half-planes are then projected from a line connecting the eye point and the down point. Each such vertical half-plane “slices” both the view screen and the height map. The slice in the view screen is called a “view screen segment” and the slice in the height map is called a “height map intersection contour.”
The number of view screen segments that originate at the down point depend upon the required sampling density at the top of the view screen. For example, if the sampling density is 0.9 pixels, a particular number of view screen segments are projected out from the down point such that, when they reach the view screen edge, they are 0.9 pixels apart.
A challenge found is that since the view screen segments originate at the down point, the view screen segments are extremely close together in proximity to the down point. In turn, a processor severely over samples around the down point, which results in wasted processor resources. Using the example described above, in order to have the rays 0.9 pixels apart at the view screen edge, the rays may be 0.025 pixels apart around the down point.
What is needed, therefore, is a system and method to dynamically alter the start point of the view screen segments in order to prevent excessive over sampling.